﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace OS.GenericDashboardViewer.WPF
{
    public class PartViewDataTemplateSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item == null)
            {
                return base.SelectTemplate(item, container);
            }
            return Application.Current.Resources[item.GetType().Name] as DataTemplate;
        }
    }
}
